<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="入库类型" prop="recptType">
        <el-select v-model="queryParams.recptType" placeholder="请选择入库类型" clearable @keyup.enter.native="handleQuery">
             <el-option
            v-for="dict in dict.type.recpt_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
            ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="入库单号" prop="recptEntryNum">
        <el-input
          v-model="queryParams.recptEntryNum"
          placeholder="请输入其他入库单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库产线" prop="recptProductionLine">
        <el-input
          v-model="queryParams.recptProductionLine"
          placeholder="请输入入库产线"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="云仓退库编码" prop="cloudStoreReturnCode">
        <el-input
          v-model="queryParams.cloudStoreReturnCode"
          placeholder="请输入云仓退库编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="采购申请编号" prop="purchaseRequestNum">
        <el-input
          v-model="queryParams.purchaseRequestNum"
          placeholder="请输入采购申请编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="外协加工编码" prop="outProcessCode">
        <el-input
          v-model="queryParams.outProcessCode"
          placeholder="请输入外协加工编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="入库物料明细-物料名称" prop="invenMaterialName">
        <el-input
          v-model="queryParams.invenMaterialName"
          placeholder="请输入入库物料明细-物料名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库物料明细-物料编码" prop="invenMaterialNum">
        <el-input
          v-model="queryParams.invenMaterialNum"
          placeholder="请输入入库物料明细-物料编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['mes:wm:item:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['mes:wm:item:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-refresh"
              size="mini"
              @click="handleSync"
             v-hasPermi="['mes:wm:item:sync']"
            >数据同步</el-button>
            </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['mes:wm:item:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['mes:wm:item:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="itemList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="入库id" align="center" prop="wmId" />
      <el-table-column label="入库类型" align="center" prop="recptType" />
      <el-table-column prop="recptEntryNum" label="入库单号" width="180">

                 <template slot-scope="scope">
                          <span @click="handleRecptEntryNumClick(scope.row.recptEntryNum)" class="highlight-link">{{ scope.row.recptEntryNum }}</span>
                 </template>

      </el-table-column>

      <el-table-column label="提交人所属部门" align="center" prop="deptName" />
      <el-table-column label="入库原因" align="center" prop="recptReason" />
      <el-table-column label="入库产线" align="center" prop="recptProductionLine" />
      <el-table-column label="是否寄冻" align="center" prop="sendFrozenOr" />
      <el-table-column label="寄冻仓库" align="center" prop="sendFrozenStore" />
      <el-table-column label="云仓退库编码" align="center" prop="cloudStoreReturnCode" />
      <!-- <el-table-column label="订单列表" align="center" prop="orderList" />
      <el-table-column label="订单列表-客户名称" align="center" prop="orderCus" />
      <el-table-column label="订单列表-订单日期" align="center" prop="orderDate" />
      <el-table-column label="订单列表-生产订单编号" align="center" prop="orderProductionNum" />
      <el-table-column label="订单列表-产品名称" align="center" prop="orderProductName" />
      <el-table-column label="订单列表-产品类型" align="center" prop="orderProductType" />
      <el-table-column label="订单列表-产品编码" align="center" prop="orderProductCode" /> -->
      <el-table-column label="销售订单编码" align="center" prop="salesOrderCode" />
      <el-table-column label="客户名称" align="center" prop="cusName" />
      <el-table-column label="合同甲方" align="center" prop="contractPartyA" />
      <el-table-column label="采购申请编号" align="center" prop="purchaseRequestNum" />
      <el-table-column label="采购需求" align="center" prop="purchaseDemand" />
      <el-table-column label="申请日期" align="center" prop="purchaseDate" />
      <el-table-column label="预计到货日期" align="center" prop="purchaseExpearrivalDate" />
      <el-table-column label="申请人" align="center" prop="purchaseApplicant" />
      <el-table-column label="申请人所属部门" align="center" prop="purchaseDept" />
      <el-table-column label="外协加工编码" align="center" prop="outProcessCode" />
      <el-table-column label="委外入库申请单编号" align="center" prop="outprocessStoreCode" />
      <el-table-column label="供应商名称" align="center" prop="supplierName" />
      <el-table-column label="供应商编码" align="center" prop="supplierCode" />
      <el-table-column label="委外干重汇总" align="center" prop="outsourcedDryWeight" />
      <el-table-column label="委外是否最后一批入库" align="center" prop="outLastStoreEntry" />
      <el-table-column label="生产报工流水号" align="center" prop="productionReportNum" />
      <el-table-column label="报工数量(单位PCS/锅数)" align="center" prop="reportQuantity" />
      <el-table-column label="生产订单编号" align="center" prop="productionOrderNum" />
      <el-table-column label="产品名称" align="center" prop="productName" />
      <el-table-column label="产品编号" align="center" prop="productNum" />
      <!-- <el-table-column label="入库物料明细" align="center" prop="invenMaterialDetails" />
      <el-table-column label="入库物料明细-所属仓库" align="center" prop="invenStoreName" />
      <el-table-column label="入库物料明细-物料名称" align="center" prop="invenMaterialName" />
      <el-table-column label="入库物料明细-客户" align="center" prop="invenCus" />
      <el-table-column label="入库物料明细-保质期(月)" align="center" prop="invenShelfLife" />
      <el-table-column label="入库物料明细-物料编码" align="center" prop="invenMaterialNum" />
      <el-table-column label="入库物料明细-规格型号" align="center" prop="invenSpec" />
      <el-table-column label="入库物料明细-采购数量" align="center" prop="invenPurchaseQuantity" />
      <el-table-column label="入库物料明细-采购来货数量" align="center" prop="invenPurchasedGoodsQuantity" />
      <el-table-column label="入库物料明细-本次入库数量" align="center" prop="receiveGoodQuantity" />
      <el-table-column label="入库物料明细-单位" align="center" prop="invenCompany" />
      <el-table-column label="入库物料明细-物料类型" align="center" prop="invenMaterialType" />
      <el-table-column label="入库物料明细-批次号" align="center" prop="invenBatchNum" />
      <el-table-column label="入库物料明细-生产日期" align="center" prop="invenProductionDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.invenProductionDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="入库物料明细-供应商名称" align="center" prop="invenSupplierName" />
      <el-table-column label="入库物料明细-备注" align="center" prop="invenRemarks" />
      <el-table-column label="入库物料明细-单箱(瓶/碗)数" align="center" prop="invenBoxesNum" />
      <el-table-column label="入库物料明细-所属车间" align="center" prop="invenWorkshop" />
      <el-table-column label="入库物料明细-已入库数" align="center" prop="invenStoredQuantity" />
      <el-table-column label="入库物料明细-总入库数" align="center" prop="invenTotalQuantity" />
      <el-table-column label="入库物料明细-采购订单编号" align="center" prop="invenPurchaseOrderNumber" />
      <el-table-column label="入库物料明细-采购单价" align="center" prop="invenPurchaseUnitPrice" />
      <el-table-column label="入库物料明细-联动单价" align="center" prop="invenLinkedUnitPrice" />
      <el-table-column label="入库物料明细-运费" align="center" prop="invenFreight" />
      <el-table-column label="入库物料明细-应付金额" align="center" prop="invenPayableAmount" />
      <el-table-column label="入库物料明细-入库编码" align="center" prop="invenWarehouseCode" />
      <el-table-column label="入库物料明细-库存数量" align="center" prop="inventoryQuantity" />
      <el-table-column label="入库物料明细-入库后数量" align="center" prop="invenQuantityAfter" />
      <el-table-column label="入库物料明细.易耗品类型" align="center" prop="invenConsumablesType" /> -->
      <el-table-column label="备注" align="center" prop="remark" />
      <!-- <el-table-column label="入库产品总数" align="center" prop="productStoreEntryTotal" />
      <el-table-column label="历史入库总数" align="center" prop="historyStoreEntryTotal" />
      <el-table-column label="总入库数" align="center" prop="totalInventoryQuantity" />
      <el-table-column label="是否存在不合格品" align="center" prop="nonProductsOr" />
      <el-table-column label="不合格品处理方法" align="center" prop="nonProductsHandleMethod" />
      <el-table-column label="质检日期" align="center" prop="qualityInspectionDate" />
      <el-table-column label="质检员" align="center" prop="qualityInspector" />
      <el-table-column label="现场照片" align="center" prop="onSitePhotos" />
      <el-table-column label="现场照片2" align="center" prop="onSitePhoto2" />
      <el-table-column label="出厂检测报告" align="center" prop="factoryInspectionReport" />
      <el-table-column label="附件" align="center" prop="enclosure" />
      <el-table-column label="质检备注" align="center" prop="qualityTestRemarks" /> -->
      <el-table-column label="入库状态" align="center" prop="entryStatus" />
      <el-table-column label="入库时间" align="center" prop="warehouseTime" />
      <el-table-column label="确认入库人名" align="center" prop="confirmReceiptName" />
      <el-table-column label="拍照" align="center" prop="photoEnclo" />
      <el-table-column label="入库列表id" align="center" prop="rklbId" />
      <el-table-column label="部门状态" align="center" prop="status" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      </el-table-column>
              <!-- 其他列根据需要添加 -->
      </el-table>


       <!-- 对话框 -->
          <el-dialog :visible.sync="dialogVisible" title="入库详情" width="80%">
            <el-tabs type="border-card" v-if="form.recptEntryNum != null">
              <!-- <el-tab-pane label="主表信息">
                <el-form :model="form" label-width="120px">
                  <el-form-item label="WM ID">
                    <el-input v-model="form.wmId" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="收货类型">
                    <el-input v-model="form.recptType" readonly></el-input>
                  </el-form-item>
                  <el-form-item label="收货条目号">
                    <el-input v-model="form.recptEntryNum" readonly></el-input>
                  </el-form-item>
                </el-form>
              </el-tab-pane> -->
              <el-tab-pane label="物料明细">
                <el-table :data="invenList" style="width: 100%">
                  <el-table-column prop="recptEntryNum" label="入库单号"></el-table-column>
                  <el-table-column prop="invenMaterialName" label="物料名称"></el-table-column>
                  <el-table-column prop="invenMaterialNum" label="物料编号"></el-table-column>
                  <el-table-column prop="invenSpec" label="规格型号"></el-table-column>
                  <el-table-column prop="invenPurchaseQuantity" label="采购数量"></el-table-column>
                  <!-- 其他列 -->
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="订单明细">
                <el-table :data="orderList" style="width: 100%">
                  <el-table-column prop="orderList" label="订单列表"></el-table-column>
                  <el-table-column prop="orderCus" label="客户"></el-table-column>
                  <el-table-column prop="orderDate" label="订单日期"></el-table-column>
                  <el-table-column prop="orderProductionNum" label="生产数量"></el-table-column>
                  <!-- 其他列 -->
                </el-table>
              </el-tab-pane>
            </el-tabs>
            <span slot="footer" class="dialog-footer">
              <el-button @click="dialogVisible = false">关闭</el-button>
            </span>
          </el-dialog>




        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['mes:wm:item:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['mes:wm:item:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改入库详情对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="入库类型" prop="recptType">
          <el-select v-model="form.recptType" placeholder="请选择入库类型">
            <el-option
            v-for="dict in dict.type.recpt_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="其他入库单编号" prop="recptEntryNum">
          <el-input v-model="form.recptEntryNum" placeholder="请输入其他入库单编号" />
        </el-form-item>
        <el-form-item label="提交人所属部门" prop="deptName">
          <el-input v-model="form.deptName" placeholder="请输入提交人所属部门" />
        </el-form-item>
        <el-form-item label="入库原因" prop="recptReason">
          <el-input v-model="form.recptReason" placeholder="请输入入库原因" />
        </el-form-item>
        <el-form-item label="入库产线" prop="recptProductionLine">
          <el-input v-model="form.recptProductionLine" placeholder="请输入入库产线" />
        </el-form-item>
        <el-form-item label="是否寄冻" prop="sendFrozenOr">
          <el-input v-model="form.sendFrozenOr" placeholder="请输入是否寄冻" />
        </el-form-item>
        <el-form-item label="寄冻仓库" prop="sendFrozenStore">
          <el-input v-model="form.sendFrozenStore" placeholder="请输入寄冻仓库" />
        </el-form-item>
        <el-form-item label="云仓退库编码" prop="cloudStoreReturnCode">
          <el-input v-model="form.cloudStoreReturnCode" placeholder="请输入云仓退库编码" />
        </el-form-item>
        <!-- <el-form-item label="订单列表" prop="orderList">
          <el-input v-model="form.orderList" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="订单列表-客户名称" prop="orderCus">
          <el-input v-model="form.orderCus" placeholder="请输入订单列表-客户名称" />
        </el-form-item>
        <el-form-item label="订单列表-订单日期" prop="orderDate">
          <el-input v-model="form.orderDate" placeholder="请输入订单列表-订单日期" />
        </el-form-item>
        <el-form-item label="订单列表-生产订单编号" prop="orderProductionNum">
          <el-input v-model="form.orderProductionNum" placeholder="请输入订单列表-生产订单编号" />
        </el-form-item>
        <el-form-item label="订单列表-产品名称" prop="orderProductName">
          <el-input v-model="form.orderProductName" placeholder="请输入订单列表-产品名称" />
        </el-form-item>
        <el-form-item label="订单列表-产品类型" prop="orderProductType">
          <el-select v-model="form.orderProductType" placeholder="请选择订单列表-产品类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="订单列表-产品编码" prop="orderProductCode">
          <el-input v-model="form.orderProductCode" placeholder="请输入订单列表-产品编码" />
        </el-form-item> -->
        <el-form-item label="销售订单编码" prop="salesOrderCode">
          <el-input v-model="form.salesOrderCode" placeholder="请输入销售订单编码" />
        </el-form-item>
        <el-form-item label="客户名称" prop="cusName">
          <el-input v-model="form.cusName" placeholder="请输入客户名称" />
        </el-form-item>
        <el-form-item label="合同甲方" prop="contractPartyA">
          <el-input v-model="form.contractPartyA" placeholder="请输入合同甲方" />
        </el-form-item>
        <el-form-item label="采购申请编号" prop="purchaseRequestNum">
          <el-input v-model="form.purchaseRequestNum" placeholder="请输入采购申请编号" />
        </el-form-item>
        <el-form-item label="采购需求" prop="purchaseDemand">
          <el-input v-model="form.purchaseDemand" placeholder="请输入采购需求" />
        </el-form-item>
        <el-form-item label="申请日期" prop="purchaseDate">
          <el-input v-model="form.purchaseDate" placeholder="请输入申请日期" />
        </el-form-item>
        <el-form-item label="预计到货日期" prop="purchaseExpearrivalDate">
          <el-input v-model="form.purchaseExpearrivalDate" placeholder="请输入预计到货日期" />
        </el-form-item>
        <el-form-item label="申请人" prop="purchaseApplicant">
          <el-input v-model="form.purchaseApplicant" placeholder="请输入申请人" />
        </el-form-item>
        <el-form-item label="申请人所属部门" prop="purchaseDept">
          <el-input v-model="form.purchaseDept" placeholder="请输入申请人所属部门" />
        </el-form-item>
        <el-form-item label="外协加工编码" prop="outProcessCode">
          <el-input v-model="form.outProcessCode" placeholder="请输入外协加工编码" />
        </el-form-item>
        <el-form-item label="委外入库申请单编号" prop="outprocessStoreCode">
          <el-input v-model="form.outprocessStoreCode" placeholder="请输入委外入库申请单编号" />
        </el-form-item>
        <el-form-item label="供应商名称" prop="supplierName">
          <el-input v-model="form.supplierName" placeholder="请输入供应商名称" />
        </el-form-item>
        <el-form-item label="供应商编码" prop="supplierCode">
          <el-input v-model="form.supplierCode" placeholder="请输入供应商编码" />
        </el-form-item>
        <el-form-item label="委外干重汇总" prop="outsourcedDryWeight">
          <el-input v-model="form.outsourcedDryWeight" placeholder="请输入委外干重汇总" />
        </el-form-item>
        <el-form-item label="委外是否最后一批入库" prop="outLastStoreEntry">
          <el-input v-model="form.outLastStoreEntry" placeholder="请输入委外是否最后一批入库" />
        </el-form-item>
        <el-form-item label="生产报工流水号" prop="productionReportNum">
          <el-input v-model="form.productionReportNum" placeholder="请输入生产报工流水号" />
        </el-form-item>
        <el-form-item label="报工数量(单位PCS/锅数)" prop="reportQuantity">
          <el-input v-model="form.reportQuantity" placeholder="请输入报工数量(单位PCS/锅数)" />
        </el-form-item>
        <el-form-item label="生产订单编号" prop="productionOrderNum">
          <el-input v-model="form.productionOrderNum" placeholder="请输入生产订单编号" />
        </el-form-item>
        <el-form-item label="产品名称" prop="productName">
          <el-input v-model="form.productName" placeholder="请输入产品名称" />
        </el-form-item>
        <el-form-item label="产品编号" prop="productNum">
          <el-input v-model="form.productNum" placeholder="请输入产品编号" />
        </el-form-item>
        <!-- <el-form-item label="入库物料明细" prop="invenMaterialDetails">
          <el-input v-model="form.invenMaterialDetails" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="入库物料明细-所属仓库" prop="invenStoreName">
          <el-input v-model="form.invenStoreName" placeholder="请输入入库物料明细-所属仓库" />
        </el-form-item>
        <el-form-item label="入库物料明细-物料名称" prop="invenMaterialName">
          <el-input v-model="form.invenMaterialName" placeholder="请输入入库物料明细-物料名称" />
        </el-form-item>
        <el-form-item label="入库物料明细-客户" prop="invenCus">
          <el-input v-model="form.invenCus" placeholder="请输入入库物料明细-客户" />
        </el-form-item>
        <el-form-item label="入库物料明细-保质期(月)" prop="invenShelfLife">
          <el-input v-model="form.invenShelfLife" placeholder="请输入入库物料明细-保质期(月)" />
        </el-form-item>
        <el-form-item label="入库物料明细-物料编码" prop="invenMaterialNum">
          <el-input v-model="form.invenMaterialNum" placeholder="请输入入库物料明细-物料编码" />
        </el-form-item>
        <el-form-item label="入库物料明细-规格型号" prop="invenSpec">
          <el-input v-model="form.invenSpec" placeholder="请输入入库物料明细-规格型号" />
        </el-form-item>
        <el-form-item label="入库物料明细-采购数量" prop="invenPurchaseQuantity">
          <el-input v-model="form.invenPurchaseQuantity" placeholder="请输入入库物料明细-采购数量" />
        </el-form-item>
        <el-form-item label="入库物料明细-采购来货数量" prop="invenPurchasedGoodsQuantity">
          <el-input v-model="form.invenPurchasedGoodsQuantity" placeholder="请输入入库物料明细-采购来货数量" />
        </el-form-item>
        <el-form-item label="入库物料明细-本次入库数量" prop="receiveGoodQuantity">
          <el-input v-model="form.receiveGoodQuantity" placeholder="请输入入库物料明细-本次入库数量" />
        </el-form-item>
        <el-form-item label="入库物料明细-单位" prop="invenCompany">
          <el-input v-model="form.invenCompany" placeholder="请输入入库物料明细-单位" />
        </el-form-item>
        <el-form-item label="入库物料明细-物料类型" prop="invenMaterialType">
          <el-select v-model="form.invenMaterialType" placeholder="请选择入库物料明细-物料类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="入库物料明细-批次号" prop="invenBatchNum">
          <el-input v-model="form.invenBatchNum" placeholder="请输入入库物料明细-批次号" />
        </el-form-item>
        <el-form-item label="入库物料明细-生产日期" prop="invenProductionDate">
          <el-date-picker clearable
            v-model="form.invenProductionDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择入库物料明细-生产日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入库物料明细-供应商名称" prop="invenSupplierName">
          <el-input v-model="form.invenSupplierName" placeholder="请输入入库物料明细-供应商名称" />
        </el-form-item>
        <el-form-item label="入库物料明细-备注" prop="invenRemarks">
          <el-input v-model="form.invenRemarks" placeholder="请输入入库物料明细-备注" />
        </el-form-item>
        <el-form-item label="入库物料明细-单箱(瓶/碗)数" prop="invenBoxesNum">
          <el-input v-model="form.invenBoxesNum" placeholder="请输入入库物料明细-单箱(瓶/碗)数" />
        </el-form-item>
        <el-form-item label="入库物料明细-所属车间" prop="invenWorkshop">
          <el-input v-model="form.invenWorkshop" placeholder="请输入入库物料明细-所属车间" />
        </el-form-item>
        <el-form-item label="入库物料明细-已入库数" prop="invenStoredQuantity">
          <el-input v-model="form.invenStoredQuantity" placeholder="请输入入库物料明细-已入库数" />
        </el-form-item>
        <el-form-item label="入库物料明细-总入库数" prop="invenTotalQuantity">
          <el-input v-model="form.invenTotalQuantity" placeholder="请输入入库物料明细-总入库数" />
        </el-form-item>
        <el-form-item label="入库物料明细-采购订单编号" prop="invenPurchaseOrderNumber">
          <el-input v-model="form.invenPurchaseOrderNumber" placeholder="请输入入库物料明细-采购订单编号" />
        </el-form-item>
        <el-form-item label="入库物料明细-采购单价" prop="invenPurchaseUnitPrice">
          <el-input v-model="form.invenPurchaseUnitPrice" placeholder="请输入入库物料明细-采购单价" />
        </el-form-item>
        <el-form-item label="入库物料明细-联动单价" prop="invenLinkedUnitPrice">
          <el-input v-model="form.invenLinkedUnitPrice" placeholder="请输入入库物料明细-联动单价" />
        </el-form-item>
        <el-form-item label="入库物料明细-运费" prop="invenFreight">
          <el-input v-model="form.invenFreight" placeholder="请输入入库物料明细-运费" />
        </el-form-item>
        <el-form-item label="入库物料明细-应付金额" prop="invenPayableAmount">
          <el-input v-model="form.invenPayableAmount" placeholder="请输入入库物料明细-应付金额" />
        </el-form-item>
        <el-form-item label="入库物料明细-入库编码" prop="invenWarehouseCode">
          <el-input v-model="form.invenWarehouseCode" placeholder="请输入入库物料明细-入库编码" />
        </el-form-item>
        <el-form-item label="入库物料明细-库存数量" prop="inventoryQuantity">
          <el-input v-model="form.inventoryQuantity" placeholder="请输入入库物料明细-库存数量" />
        </el-form-item>
        <el-form-item label="入库物料明细-入库后数量" prop="invenQuantityAfter">
          <el-input v-model="form.invenQuantityAfter" placeholder="请输入入库物料明细-入库后数量" />
        </el-form-item>
        <el-form-item label="入库物料明细.易耗品类型" prop="invenConsumablesType">
          <el-select v-model="form.invenConsumablesType" placeholder="请选择入库物料明细.易耗品类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item> -->
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="入库产品总数" prop="productStoreEntryTotal">
          <el-input v-model="form.productStoreEntryTotal" placeholder="请输入入库产品总数" />
        </el-form-item>
        <el-form-item label="历史入库总数" prop="historyStoreEntryTotal">
          <el-input v-model="form.historyStoreEntryTotal" placeholder="请输入历史入库总数" />
        </el-form-item>
        <el-form-item label="总入库数" prop="totalInventoryQuantity">
          <el-input v-model="form.totalInventoryQuantity" placeholder="请输入总入库数" />
        </el-form-item>
        <el-form-item label="是否存在不合格品" prop="nonProductsOr">
          <el-input v-model="form.nonProductsOr" placeholder="请输入是否存在不合格品" />
        </el-form-item>
        <el-form-item label="不合格品处理方法" prop="nonProductsHandleMethod">
          <el-input v-model="form.nonProductsHandleMethod" placeholder="请输入不合格品处理方法" />
        </el-form-item>
        <el-form-item label="质检日期" prop="qualityInspectionDate">
          <el-input v-model="form.qualityInspectionDate" placeholder="请输入质检日期" />
        </el-form-item>
        <el-form-item label="质检员" prop="qualityInspector">
          <el-input v-model="form.qualityInspector" placeholder="请输入质检员" />
        </el-form-item>
        <el-form-item label="现场照片" prop="onSitePhotos">
          <el-input v-model="form.onSitePhotos" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="现场照片2" prop="onSitePhoto2">
          <el-input v-model="form.onSitePhoto2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="出厂检测报告" prop="factoryInspectionReport">
          <el-input v-model="form.factoryInspectionReport" placeholder="请输入出厂检测报告" />
        </el-form-item>
        <el-form-item label="附件" prop="enclosure">
          <el-input v-model="form.enclosure" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="质检备注" prop="qualityTestRemarks">
          <el-input v-model="form.qualityTestRemarks" placeholder="请输入质检备注" />
        </el-form-item>
        <el-form-item label="入库状态">
          <el-radio-group v-model="form.entryStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="入库时间" prop="warehouseTime">
          <el-input v-model="form.warehouseTime" placeholder="请输入入库时间" />
        </el-form-item>
        <el-form-item label="确认入库人名" prop="confirmReceiptName">
          <el-input v-model="form.confirmReceiptName" placeholder="请输入确认入库人名" />
        </el-form-item>
        <el-form-item label="拍照" prop="photoEnclo">
          <el-input v-model="form.photoEnclo" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="入库列表id" prop="rklbId">
          <el-input v-model="form.rklbId" placeholder="请输入入库列表id" />
        </el-form-item>
        <el-form-item label="部门状态">
          <el-radio-group v-model="form.status">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="删除标志" prop="delFlag">
          <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
        </el-form-item>
        <el-form-item label="入库明细id" prop="invenId">
                  <el-input v-model="form.invenId" placeholder="请输入入库明细id" />
                </el-form-item>
                <el-form-item label="订单id" prop="orderId">
                  <el-input v-model="form.orderId" placeholder="请输入订单id" />
                </el-form-item>
                <el-form-item label="部门id" prop="deptId">
                  <el-input v-model="form.deptId" placeholder="请输入部门id" />
                </el-form-item>
                <el-form-item label="申请人id" prop="purchaseApplicantId">
                  <el-input v-model="form.purchaseApplicantId" placeholder="请输入申请人id" />
                </el-form-item>
                <el-form-item label="申请人部门id" prop="purchaseDeptNo">
                  <el-input v-model="form.purchaseDeptNo" placeholder="请输入申请人部门id" />
                </el-form-item>
                <el-form-item label="质检人id" prop="qualityInspectorId">
                  <el-input v-model="form.qualityInspectorId" placeholder="请输入质检人id" />
                </el-form-item>
                <el-divider content-position="center">入库列表-物料信息表信息</el-divider>
                <el-row :gutter="10" class="mb8">
                  <el-col :span="1.5">
                    <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddWmItemListInven">添加</el-button>
                  </el-col>
                  <el-col :span="1.5">
                    <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteWmItemListInven">删除</el-button>
                  </el-col>
                </el-row>
                <!-- <el-table :data="wmItemListInvenList" :row-class-name="rowWmItemListInvenIndex" @selection-change="handleWmItemListInvenSelectionChange" ref="wmItemListInven">
                  <el-table-column type="selection" width="50" align="center" />
                  <el-table-column label="序号" align="center" prop="index" width="50"/>
                  <el-table-column label="关联主表-入库单编号" prop="recptEntryNum" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.recptEntryNum" placeholder="请输入关联主表-入库单编号" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-所属仓库" prop="invenStoreName" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenStoreName" placeholder="请输入入库物料明细-所属仓库" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-物料名称" prop="invenMaterialName" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenMaterialName" placeholder="请输入入库物料明细-物料名称" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-客户" prop="invenCus" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenCus" placeholder="请输入入库物料明细-客户" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-保质期(月)" prop="invenShelfLife" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenShelfLife" placeholder="请输入入库物料明细-保质期(月)" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-物料编码" prop="invenMaterialNum" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenMaterialNum" placeholder="请输入入库物料明细-物料编码" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-规格型号" prop="invenSpec" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenSpec" placeholder="请输入入库物料明细-规格型号" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-采购数量" prop="invenPurchaseQuantity" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenPurchaseQuantity" placeholder="请输入入库物料明细-采购数量" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-采购来货数量" prop="invenPurchasedGoodsQuantity" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenPurchasedGoodsQuantity" placeholder="请输入入库物料明细-采购来货数量" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-本次入库数量" prop="receiveGoodQuantity" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.receiveGoodQuantity" placeholder="请输入入库物料明细-本次入库数量" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-单位" prop="invenCompany" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenCompany" placeholder="请输入入库物料明细-单位" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-物料类型" prop="invenMaterialType" width="150">
                    <template slot-scope="scope">
                      <el-select v-model="scope.row.invenMaterialType" placeholder="请选择入库物料明细-物料类型">
                        <el-option label="请选择字典生成" value="" />
                      </el-select>
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-批次号" prop="invenBatchNum" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenBatchNum" placeholder="请输入入库物料明细-批次号" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-生产日期" prop="invenProductionDate" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenProductionDate" placeholder="请输入入库物料明细-生产日期" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-供应商名称" prop="invenSupplierName" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenSupplierName" placeholder="请输入入库物料明细-供应商名称" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-备注" prop="invenRemarks" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenRemarks" placeholder="请输入入库物料明细-备注" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-单箱(瓶/碗)数" prop="invenBoxesNum" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenBoxesNum" placeholder="请输入入库物料明细-单箱(瓶/碗)数" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-所属车间" prop="invenWorkshop" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenWorkshop" placeholder="请输入入库物料明细-所属车间" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-已入库数" prop="invenStoredQuantity" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenStoredQuantity" placeholder="请输入入库物料明细-已入库数" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-总入库数" prop="invenTotalQuantity" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenTotalQuantity" placeholder="请输入入库物料明细-总入库数" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-采购订单编号" prop="invenPurchaseOrderNumber" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenPurchaseOrderNumber" placeholder="请输入入库物料明细-采购订单编号" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-采购单价" prop="invenPurchaseUnitPrice" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenPurchaseUnitPrice" placeholder="请输入入库物料明细-采购单价" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-联动单价" prop="invenLinkedUnitPrice" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenLinkedUnitPrice" placeholder="请输入入库物料明细-联动单价" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-运费" prop="invenFreight" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenFreight" placeholder="请输入入库物料明细-运费" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-应付金额" prop="invenPayableAmount" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenPayableAmount" placeholder="请输入入库物料明细-应付金额" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-入库编码" prop="invenWarehouseCode" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenWarehouseCode" placeholder="请输入入库物料明细-入库编码" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-库存数量" prop="inventoryQuantity" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.inventoryQuantity" placeholder="请输入入库物料明细-库存数量" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细-入库后数量" prop="invenQuantityAfter" width="150">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.invenQuantityAfter" placeholder="请输入入库物料明细-入库后数量" />
                    </template>
                  </el-table-column>
                  <el-table-column label="入库物料明细.易耗品类型" prop="invenConsumablesType" width="150">
                    <template slot-scope="scope">
                      <el-select v-model="scope.row.invenConsumablesType" placeholder="请选择入库物料明细.易耗品类型">
                        <el-option label="请选择字典生成" value="" />
                      </el-select>
                    </template>
                  </el-table-column>
                </el-table> -->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>



<style scoped>.highlight-column {
  background-color: #f0f9eb; /* 背景颜色 */
}

.highlight-link {
  color: blue;
  cursor: pointer;
  text-decoration: underline;
}
</style>




<script>
import { listItem, getItem, delItem, addItem, updateItem,syncWmItem,getInvenList, getOrderList } from "@/api/mes/wm/item";


export default {
  name: "Item",
  dicts: ['recpt_type'],

  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 入库详情表格数据
      itemList: [],
            loading: false,
            queryParams: {},
            dialogVisible: false,
            form: {},
            invenList: [],
            orderList: [],



      // // 入库列表-物料信息表表格数据
      // wmItemListInvenList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        rklbId: null,        recptType: null,        recptEntryNum: null,        deptName: null,        recptReason: null,        recptProductionLine: null,        sendFrozenOr: null,        sendFrozenStore: null,        cloudStoreReturnCode: null,        orderList: null,        orderCus: null,        orderDate: null,        orderProductionNum: null,        orderProductName: null,        orderProductType: null,        orderProductCode: null,        salesOrderCode: null,        cusName: null,        contractPartyA: null,        purchaseRequestNum: null,        purchaseDemand: null,        purchaseDate: null,        purchaseExpearrivalDate: null,        purchaseApplicant: null,        purchaseDept: null,        outProcessCode: null,        outprocessStoreCode: null,        supplierName: null,        supplierCode: null,        outsourcedDryWeight: null,        outLastStoreEntry: null,        productionReportNum: null,        reportQuantity: null,        productionOrderNum: null,        productName: null,        productNum: null,        invenMaterialDetails: null,        invenStoreName: null,        invenMaterialName: null,        invenCus: null,        invenShelfLife: null,        invenMaterialNum: null,        invenSpec: null,        invenPurchaseQuantity: null,        invenPurchasedGoodsQuantity: null,        receiveGoodQuantity: null,        invenCompany: null,        invenMaterialType: null,        invenBatchNum: null,        invenProductionDate: null,        invenSupplierName: null,        invenRemarks: null,        invenBoxesNum: null,        invenWorkshop: null,        invenStoredQuantity: null,        invenTotalQuantity: null,        invenPurchaseOrderNumber: null,        invenPurchaseUnitPrice: null,        invenLinkedUnitPrice: null,        invenFreight: null,        invenPayableAmount: null,        invenWarehouseCode: null,        inventoryQuantity: null,        invenQuantityAfter: null,        invenConsumablesType: null,        remarks: null,        productStoreEntryTotal: null,        nonProductsOr: null,        nonProductsHandleMethod: null,        qualityInspectionDate: null,        qualityInspector: null,        onSitePhotos: null,        onSitePhoto2: null,        factoryInspectionReport: null,        enclosure: null,        qualityTestRemarks: null,        entryStatus: null,        warehouseTime: null,        confirmReceiptName: null,        photoEnclo: null,        status: null,        invenId: null,        orderId: null,        deptId: null,        purchaseApplicantId: null,        purchaseDeptNo: null,        qualityInspectorId: null      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();

  },
  methods: {
    /** 查询入库详情列表 */
    getList() {
      this.loading = true;
      listItem(this.queryParams).then(response => {
        this.itemList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },



       handleRecptEntryNumClick(recptEntryNum) {
         console.log("recptEntryNum>>"+recptEntryNum)
            this.dialogVisible = true;
            this.form.recptEntryNum = recptEntryNum;
            this.getInvenList(recptEntryNum);
            this.getOrderList(recptEntryNum);
          },
          getInvenList(recptEntryNum) {
            getInvenList({ recptEntryNum }).then(response => {
              this.invenList = response.rows;
            });
          },
          getOrderList(recptEntryNum) {
                getOrderList({ recptEntryNum }).then(response => {
                  this.orderList = response.rows;
                });
              },





    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
      wmId: null,        rklbId: null,        recptType: null,        recptEntryNum: null,        deptName: null,        recptReason: null,        recptProductionLine: null,        sendFrozenOr: null,        sendFrozenStore: null,        cloudStoreReturnCode: null,        orderList: null,        orderCus: null,        orderDate: null,        orderProductionNum: null,        orderProductName: null,        orderProductType: null,        orderProductCode: null,        salesOrderCode: null,        cusName: null,        contractPartyA: null,        purchaseRequestNum: null,        purchaseDemand: null,        purchaseDate: null,        purchaseExpearrivalDate: null,        purchaseApplicant: null,        purchaseDept: null,        outProcessCode: null,        outprocessStoreCode: null,        supplierName: null,        supplierCode: null,        outsourcedDryWeight: null,        outLastStoreEntry: null,        productionReportNum: null,        reportQuantity: null,        productionOrderNum: null,        productName: null,        productNum: null,        invenMaterialDetails: null,        invenStoreName: null,        invenMaterialName: null,        invenCus: null,        invenShelfLife: null,        invenMaterialNum: null,        invenSpec: null,        invenPurchaseQuantity: null,        invenPurchasedGoodsQuantity: null,        receiveGoodQuantity: null,        invenCompany: null,        invenMaterialType: null,        invenBatchNum: null,        invenProductionDate: null,        invenSupplierName: null,        invenRemarks: null,        invenBoxesNum: null,        invenWorkshop: null,        invenStoredQuantity: null,        invenTotalQuantity: null,        invenPurchaseOrderNumber: null,        invenPurchaseUnitPrice: null,        invenLinkedUnitPrice: null,        invenFreight: null,        invenPayableAmount: null,        invenWarehouseCode: null,        inventoryQuantity: null,        invenQuantityAfter: null,        invenConsumablesType: null,        remarks: null,        productStoreEntryTotal: null,        nonProductsOr: null,        nonProductsHandleMethod: null,        qualityInspectionDate: null,        qualityInspector: null,        onSitePhotos: null,        onSitePhoto2: null,        factoryInspectionReport: null,        enclosure: null,        qualityTestRemarks: null,        entryStatus: "0",        warehouseTime: null,        confirmReceiptName: null,        photoEnclo: null,        status: "0",        delFlag: null,        createBy: null,        createTime: null,        updateBy: null,        updateTime: null,        invenId: null,        orderId: null,        deptId: null,        purchaseApplicantId: null,        purchaseDeptNo: null,        qualityInspectorId: null      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.recptEntryNum)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case "handleSelectInven":
          this.handleSelectInven(row);
          break;
        case "handleSelectOrder":
          this.handleSelectOrder(row);
          break;
        default:
          break;
      }
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加入库详情";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const rklbId = row.rklbId || this.ids
      getItem(rklbId).then(response => {
        this.form = response.data;
        // this.wmItemListInvenList = response.data.wmItemListInvenList;
        this.open = true;
        this.title = "修改入库详情";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          // this.form.wmItemListInvenList = this.wmItemListInvenList;
          if (this.form.wmId != null) {
            updateItem(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addItem(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const recptEntryNums = row.recptEntryNum || this.ids;
      this.$modal.confirm('是否确认删除入库详情编号为"' + recptEntryNums + '"的数据项？').then(function() {
        return delItem(recptEntryNums);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
        /** 复选框选中数据 */
        handleWmItemListInvenSelectionChange(selection) {
          this.checkedWmItemListInven = selection.map(item => item.index)
        },
    /** 同步数据按钮操作 */
    handleSync() {
            if(this.loading){
              this.$modal.message("正常进行中，请不要重复点击...")
            }
            this.loading = true;
            this.$modal.confirm('是否确认同步数据？').then(function() {
              return syncWmItem();
            }).then(() => {
              this.getList();
              this.$modal.msgSuccess("同步成功");
            }).catch(() => {});
          },
    /** 导出按钮操作 */
    handleExport() {
      this.download('wm/item/export', {
        ...this.queryParams
      }, `item_${new Date().getTime()}.xlsx`)
    }
  }
};


</script>
